<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <cpn1></cpn1>

        <cpn2></cpn2>
    </div>
    <div id="app1">
        <cpn1></cpn1>

        <cpn2></cpn2>
    </div>
    <script src="../vue.js"></script>
    <script>
         //1. 创建组件构造器
         const cpnC1 = Vue.extend({
            template: `
            <div>
                <img width="100px" src="11.jfif" alt="">
                <h2>海尔兄弟 双开门冷酷至尊土豪版</h2>
                <h1><font color="red">$999</font></h1>
             </div>
            `
        });
        //2. 注册全局的组件
        Vue.component("cpn1", cpnC1);


        //局部组件的构造器
        const cpnC2 = Vue.extend({
            template: `
            <div>
                <h2>二类哦四的撒旦</h2>
                <p>卢卡斯的积分是否健康绿色健康发生了尽快付款</p>
             </div>
            `
        });
        var app = new Vue({
            el:"#app",
            data:{
            },
            // 局部的注册组件
            components:{
                cpn2: cpnC2
            }
        });
        var app1 = new Vue({
            el:"#app1",
            data:{
            }
        });
    </script>
</body>
</html>